<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎访问用户中心 -- 用户登录</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/base.css" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
	function changeValidateCode(obj) {
		//获取当前的时间作为参数，无具体意义    
		var timenow = new Date().getTime();
		//每次请求需要一个不同的参数，否则可能会返回同样的验证码    
		//这和浏览器的缓存机制有关系，也可以把页面设置为不缓存，这样就不用这个参数了。    
		obj.src = "rand.action?d=" + timenow;
	}

	$(document).ready(function() {
		$("#userName").focus(function() { //文本框获得焦点
			if ($(this).val() == "登录用户名") {
				$(this).val("")};
			$(this).css("color", "#333333");
		}).blur(function() {//文本框失去焦点
			if ($(this).val() == "") {
				$(this).val("登录用户名").css({"color" : "#999999"})
			}
		})
		$("#login-form").bind("submit", function() {
			return checkFroms();
		})
	});
</script>

</head>
<body onload="changeValidateCode(document.getElementById('randImg'));">
	<div class="container">
		<div style="margin-top: 95px;">
			<div class="xmLogin cfl">
				<div class="xmLogin_form">
					<h2 align="center">欢迎来到用户中心</h2>
					<form id="login-form" action="${pageContext.request.contextPath}/student!login.action" method="post">
						<ul class="xmBox_login">
							<li class="cfl">
								<label for="LoginForm_username"class="required">帐&nbsp;&nbsp;号 <span class="required">*</span></label>
								<input name="students.userName" id="userName" type="text" />
							</li>
							<li class="xmBox_login_psw cfl">
								<label for="LoginForm_password" class="required">密&nbsp;&nbsp;码<span class="required">*</span> </label>
								<input name="students.passWord" id="passWord" type="password" />
							</li>
							<li class="xmBox_login_psw cfl">
								<label for="LoginForm_password" class="required">验证码 <span class="required">*</span></label>
								<input name="rand" type="text" onkeyup="value=value.replace(/[^\d]/g,'')" style="width: 80px; margin-left:5px; float: left;" maxlength="6" size="6" /> 
								<!-- <img src="${pageContext.request.contextPath}/rand.action" id="randImg" title="点击图片刷新验证码"  border="0" align="middle" onclick="changeValidateCode(this);" style="width: 140px; height:37px; margin-left:5px; float: left; cursor: pointer;">
								-->
							</li>
						</ul>
						<div class="row rememberMe"></div>
						<div class="xmBox_login_Btn">
							<input class="T_loginBtn" type="submit" name="yt0" value=" " />
						</div>
						<p class="xmBox_login_reginTips">
							你还没有帐号？&nbsp;&nbsp;&nbsp;
							<a href="${pageContext.request.contextPath}/register.jsp" class="regNow" style="text-decoration: underline;font-weight: bold;">立刻注册</a>
						</p>
					</form>
				</div>
				<!-- form -->
			</div>
		</div>
		<!-- content -->
	</div>
</body>
</html>